//api文件仍保留但不建议使用，推荐使用models中的api。API files remain preserved (deprecated), use models APIs instead.
import type { Permissions, PermissionsResponse } from './types.js';

import { requestClient } from '#/api/request';

export const getuctooPermissionsList = async (page: number, pageSize: number,
  searchParams?: any) => {
  return requestClient.get<PermissionsResponse>(`/uctoo/permissions/${pageSize}/${page}`,{
    params: searchParams,
  });
};

export const getuctooPermissions = async (id: string) => {
  return requestClient.get<Permissions>(`/uctoo/permissions/${id}`);
};

export const adductooPermissions = async (data: Partial<Permissions>) => {
  return requestClient.post<Permissions>('/uctoo/permissions/add', data);
};

export const edituctooPermissions = async (data: Partial<Permissions>) => {
  return requestClient.post<Permissions>('/uctoo/permissions/edit', data);
};

export const deleteuctooPermissions = async (id: string) => {
  return requestClient.post<any>('/uctoo/permissions/del', { id });
};
